package Calendar;

import java.util.Calendar;

public class CalendarDemo3 {
    public static void main(String[] args) {
        Calendar cal=Calendar.getInstance();
        //设置年
        cal.set(Calendar.YEAR,2034);
        //获取年
        int year = cal.get(Calendar.YEAR);
        // 获取月
        int month = cal.get(Calendar.MONTH)+1;
        // 获取日
        int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
        System.out.print(year + "年" + month + "月" + dayOfMonth + "日");
    }
}
